package com.dyw.ycgovfinance.app;

import android.app.Application;
import android.content.Context;

import com.dyw.ycgovfinance.BuildConfig;
import com.dyw.ycgovfinance.commom.Config;
import com.dyw.ycgovfinance.http.HttpService;
import com.dyw.ycgovfinance.util.LogUtil;

/**
 * Created by Administrator on 2017/6/20.
 */

public class CustomApplication extends Application {


    public static Context globeContext;
    private static CustomApplication mInstance;

    public static CustomApplication getInstance() {
        return mInstance;
    }


    private HttpService mHttpService;

    public HttpService getHttpService() {
        if (mHttpService == null) {
            mHttpService = HttpService.Factory.create(Config.URL_BASE_IN_USE);
        }
        return mHttpService;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        mInstance = this;
        globeContext = this;
        initHttpService();
        initLog();

    }

    private void initHttpService()
    {
        mHttpService = HttpService.Factory.create(Config.URL_BASE_IN_USE);
    }
    private void initLog() {
        LogUtil.isDebug = BuildConfig.DEBUG;
    }

}
